# -*- coding: utf-8 -*-
import logging

from apscheduler.schedulers.background import BackgroundScheduler

from examples.recorder_utils import run_data_recorder
from zvt import init_log
from zvt.domain import (
    Stock,
    StockDetail,
    FinanceFactor,
    BalanceSheet,
    IncomeStatement,
    CashFlowStatement,
)

logger = logging.getLogger(__name__)

sched = BackgroundScheduler()


def record_actor_data(data_provider="eastmoney", entity_provider="eastmoney"):
    # run_data_recorder(domain=Stock, data_provider=data_provider)
    # run_data_recorder(domain=StockDetail, data_provider=data_provider)
    # run_data_recorder(domain=FinanceFactor, data_provider=data_provider, entity_provider=entity_provider, day_data=True)
    # run_data_recorder(domain=BalanceSheet, data_provider=data_provider, entity_provider=entity_provider, day_data=True)
    # run_data_recorder(
    #     domain=IncomeStatement, data_provider=data_provider, entity_provider=entity_provider, day_data=True
    # )
    run_data_recorder(
        domain=CashFlowStatement, data_provider=data_provider, entity_provider=entity_provider, day_data=True,sleeping_time=2
    )


if __name__ == "__main__":
    init_log("finance_runner2.log")

    record_actor_data()

